//波次单
$(function(){
	//搜索
	$('.searchBar').click(function(){
		var thisform=$(this).parent('form');
		var start_time=thisform.find('input[name=start_time]').val();
		var end_time=thisform.find('input[name=end_time]').val();
		var cate=thisform.find('input[name=cate]').val();
		$('#pushorderlistDatagrid').datagrid('options').pageNumber=1;//设置页码初始值为1
		$('#pushorderlistDatagrid').datagrid({
			queryParams:{
				cate:cate,
				start_time:start_time,
				end_time:end_time
			}
		});
	})

	$('#pushorderlistDatagrid').datagrid({
		url:getpushOrderlistUrl,
		title:'出库统计列表',
		fitColumns:true,
		rownumbers:true,
		pageSize:25,
		pageNumber:1,
		pageList:[5,10,15,20,25,30,40,50],
		columns:[[
		{field:'id',title:'id',checkbox:true},
		{field:'count',title:'统计数量',sortable:true},
		{field:'update_time',title:'统计时间',sortable:true},
		{field:'cate',title:'类型',
			formatter:function(value,row,index){
				if (value==1){
					return "出库";
				} 
				if (value==2){
					return "打包";
				}
				if (value==3){
					return "称重";
				}
			}
		}
		]],
		onLoadError:function(data){
			var info=eval('('+data.responseText+')');
			$.messager.confirm('错误提示',info.message,function(r){
				var tab=$('#Tabs').tabs('getSelected');
				var index=$('#Tabs').tabs('getTabIndex',tab);
				$('#Tabs').tabs('close',index);
			});
		},
		onLoadSuccess:function(){
			//回车
			// $('#pushorderlist_mailNo').textbox('textbox').keydown(function (e) {
		//         if (e.keyCode == 13) {
		//            $('.sumitBar').click();
		//         }
		//     });
		},
		rowStyler:function(index,row){
			if (row.color==0){
				return 'background-color:pink;color:blue;font-weight:bold;';
			}
		},
		pagination:true,
		fit:true,
	});
});
pushorderlistObj={
	showAll:function(){
		$('#pushorderlistDatagrid').datagrid({ queryParams:''});
	}
}